﻿@model ZSZ.DTO.PermissionDTO
@{
    ViewBag.Title = "修改权限项";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<table>
    <tr>
        <td>名字：</td>
        <td><input type="text" id="name" value="@Model.Name" /></td>
    </tr>
    <tr>
        <td>描述：</td>
        <td><input type="text" id="miaoshu" value="@Model.Description" /></td>
    </tr>
    <tr>
        <td colspan="2">
            <button id="save">保存</button>
        </td>
    </tr>
</table>
@section footerjs{
    <script type="text/javascript">
        $('#save').click(function () {
            var name = $('#name').val();
            var miao = $('#miaoshu').val();
            $.ajax({
                url: '/Permission/Edit/' +@Model.Id,
                data: { name: name, miaoshu: miao },
                dataType: 'json',
                type: 'post',
                success: function (res) {
                    if (res.status == 'ok') {
                        parent.location.reload();
                    } else {
                        alert(res.errorMsg);
                    }
                },
                error: function () {
                    alert('网络请求错误');
                }
            })
        })
    </script>
}

